<?php

add_action( 'after_setup_theme', '_setup' );

/**
 * initialize Theme
 */
function _setup()
{
	_i18n_setup();
	_admin_setup();
	_slider_setup();
}

/**
 * Load po/mo files for i18n
 */
function _i18n_setup()
{
	$locale_file = get_template_directory() . '/language';
	load_theme_textdomain( 'devster', $locale_file );
}

/**
 * Setup the admin configuration
 */
function _admin_setup()
{
	if( is_admin() )
	{
		require_once(dirname(__FILE__).'/admin/admin-setup.php');
	}
}

/**
 * Setup the Nivo-Slider configuration
 */
function _slider_setup()
{
	require_once(dirname(__FILE__).'/slider/slider-setup.php');
}

// Redirect to home page after login
function my_login_redirect($redirect_to, $request)
{
	return home_url();
}
add_filter("login_redirect", "my_login_redirect", 10, 3);

?>